Method and apparatus for processing null packets in a digital media receiver

ABSTRACT

A method and apparatus for reliably detecting MPEG-2 packet sync-byte positions received via a digital transmission system in the event of a packet stream containing a plurality of null packets of a plurality of packets containing a fixed repeating bit pattern and for reliably synchronizing and delivering the MPEG-2 stream broadcast to the receiver transport layer. A Null-Packet Detector compares the content of the current packet with a fixed (or predetermined) bit pattern to detect a null packet to reliably identify the location of the sync-byte of the null packet. a sync-byte position is identified based upon the position of the predetermined fixed bit pattern in the header portion of a plurality of null-packets in the stream.

This application claims the benefit, under 35 U.S.C. § 365 ofInternational Application PCT/US2004/019003 filed Jun. 16, 2004, whichwas published in accordance with PCT Article 21(2) on Dec. 29, 2004 inEnglish and which claims the benefit of U.S. provisional patentapplication No. 60/479,397 filed Jun. 18, 2003.

FIELD OF THE INVENTION

The present invention relates to transmitting and receiving multimediadata including digital video and audio, and more particularly to amethod and apparatus for reliably synchronizing and delivering an MPEG-2stream broadcast over such a digital transmission system to the receivertransport layer.

DESCRIPTION OF THE RELATED ART

Digital transmission systems offer consumers high-quality multimediadata including compressed audio and video streams. For broadcasters, thecompression of data allows several programs to be delivered over thesame analog bandwidth. The audio and video components of a program arecompressed at the source and time-multiplexed with other programs andsystem information needed to recreate the original program. The digitalmultiplex is processed by a physical layer and transmitted to theconsumer. At the consumer end, the receiver processes the signal torecover the multiplexed digital streams, extracts the program ofinterest, and decodes the compressed audio and video for presentation ona video/audio display such as a television.

To promote the development of interoperable components from differentmanufacturers, the MPEG-2 international compression standard wasdeveloped. The standard does not specify the techniques for encoding,multiplexing, and decoding the bit streams, but only the format of thedata. This leaves an opportunity for manufacturers to differentiatetheir products through the way in which they use resources such assilicon, processor power, and memory, and through their ability toconceal or recover from errors. The standard is composed of threeprimary parts covering systems, video, and audio. The video and audioparts specify the format of the compressed video and audio data, whilethe systems part specifies the formats for multiplexing the audio andvideo data for one or more programs as well as information necessary forrecovery of the programs.

The ANSI/SCTE 07 2000 (formerly SCTE DVS 031) and ITU-T J.83B standards,which are nearly identical, describe a digital transmission system forcable distribution of video, sound and data services. In particular, theANSI/SCTE 07 2000 standard describes the adopted standard for digitalcable transmission in the U.S. In both standards, the data format inputto the physical layer (channel coding and modulation) is assumed to beMPEG-2 transport.

In the physical layer, the MPEG framing is the outermost layer ofprocessing. At the transmitter, the MPEG framing block is followed bythe Forward Error Correction (FEC) encoder and the 64 or 256 QuadratureAmplitude Modulator (QAM). An FEC system is a class of methods forcontrolling errors in a one-way communication system such as an MPEG-2stream. An FEC encoder sends extra information along with the data,which can be used by the receiver to check and correct the data. The FECencoder consists of concatenated systems including a Reed-Solomon (RS)encoder, an interleaver capable of several modes, a randomizer and atrellis encoder. It produces high coding gain at moderate complexity andoverhead. The FEC system is optimized for quasi error free operation ata threshold output error event rate of one error event per 15 minutes.At the receiver, the corresponding functions of demodulation and FECdecoding are performed, followed by the MPEG framing block.

The MPEG framing processing block at the receiver delivers an MPEG-2transport data stream consisting of a continuous stream of fixed length(188 bytes) packets that are transmitted in serial fashion, mostsignificant bit (MSB) first.

The so-called “link” header of each packet contains fields for packetsynchronization and identification, error indication, and conditionalaccess. The subsequent adaptation header carries synchronization andtiming information for decoding and presentation process. The payload(1496 bits) can contain any multimedia data including compressed videoand audio streams.

The data packets of the MPEG-2 transport layer have 188 bytes, beginningwith a four-byte transport packet header, the header having one byte forsynchronization purposes (called sync byte and having a constant valueof 47Hex), and three subsequent bytes containing service identification,scrambling and control information.

The four-byte transport packet header is followed by 184 bytes of MPEG-2or auxiliary data. The transport packet header is as laid out in thefollowing order:

a) Sync byte: 8 bits consisting of a fixed value of 0x47 (47Hex)

b) Transport_error_Indicator: 1 bit indicating an uncorrectable biterror in the current transport packet. This information may be set bythe transmitter or the receiver.

c) Payload_unit_start_indicator: 1 bit indicating the presence of a newPES (Packetized Elementary Stream) packet or a new TS_PSI (TransportStream-Program Specific Information) section.

d) Transport_priority: 1 bit indicating a higher priority than otherpackets.

e) PID: 13-bit packet ID. Values 0 and 1 are preassigned, while values 2to 15 are reserved. Values 0x0010 to 0x1FFE may be assigned by theProgram Specific Information (PSI). Value 0x1FFF is reserved for nullpackets.

f) Transport_scrambling control: 2 bits indicating the scrambling modeof the packet payload.

g) Adaptation_field_control: 2 bits indicating the presence of anadaptation field or payload data field.

h) Continuity_counter: 4 bits, representing one continuity_counter perPID value. It increments with each nonrepeated transport stream packethaving the corresponding PID value.

A broadcast MPEG-2 stream may contain several multiplexed programs ofaudio and video data, along with the necessary system data, and eachpacket of data is identified by a unique tag or PID within the packetheader.

A section of the MPEG-2 data stream could be heavily biased in aparticular PID, or evenly weighted across many PIDs, or could contain ahigh percentage of null packets. Errors, known and unknown, are inherentin transport stream delivery and can occur at any time. Unknown errorssuch as bit corruption or data loss can occur at any bit position of thestream, and may mislead the transport into unusual behavior.

The MPEG-2 sync byte is intended to facilitate packet delineation at adecoder. However, unlike many other digital transmission standards, themethod used for MPEG-2 synchronization in the digital cable transmissionsystem physical layer is de-coupled from the Forward Error Correction(FEC) synchronization. First, the MPEG-2 packet does not contain aninteger number of FEC frames, or even Reed-Solomon (RS) codewords.Reed-Solomon (RS) Coding, using a (128,122) code, provides blockencoding and decoding to correct up to three 7-bit symbols within an RSblock. Hence, the MPEG-2 packets and the FEC frames, or the MPEG-2packets and RS codewords are asynchronous with respect to each other.Second, the sync byte is replaced inside the MPEG framing block at thetransmission site by a parity checksum that is a coset of an FIR paritycheck linear block code.

Hence, the MPEG framing block at the receiver site needs to decode thisparity check block code in order to recover the sync byte and then lockto it. It then delivers MPEG packet synchronization to the downstreamreceiver blocks, including the transport block. The output of this blockmay include an output clock, the data stream, in serial or parallelformat, a sync signal identifying the position of the sync byte in thedata stream, a valid signal identifying when data is present at theoutput data stream and an error signal identifying whether the packet isconsidered invalid (uncorrectable errors) or error free.

This synchronization de-coupling feature is incorporated as anadditional layer of processing to make use of the information bearingcapacity of the sync byte. At the transmitter, a parity checksum whichis a coset of an FIR (finite impulse response) parity check linear blockcode (LBC or FIR-PCC) is substituted for this sync byte, for the purposeof improved packet delineation functionality, and error detectioncapability independent of the FEC layer. The parity checksum is computedover the adjacent 187 bytes, which constitute the immediately precedingMPEG-2 packet content (minus sync byte). The parity checks of the blockcode are computed at the receiver by observing the output of a finiteimpulse response (FIR), linear time-invariant (binary) filter. Theparity check structure is based on a PN sequence generated by a (binary)primitive polynomial.

At the transmitter side, the checksum is computed by passing the 1496payload bits through a linear feedback shift register (LFSR) asdescribed by the following equation:f(X)=[1+X ¹⁴⁹⁷ b(X)]/g(X), where g(X)=1+X+X ⁵ +X ⁶ +X ⁸ and b(X)=1+X ³+X ⁷.

An offset of 67Hex is added to this checksum result for improvedautocorrelation properties, and causes a 47Hex result to be producedduring a syndrome decode operation when a valid code word is present.This structure allows for a computationally efficient implementation ofthe parity check FIR filter, in a recursive manner, that is generallyself-synchronizing and therefore supports simultaneous packetsynchronization and error detection. The decoder computes a slidingchecksum on the serial data stream, using the detection of a valid codeword to detect the start of a packet.

A parity check matrix is used by the decoder to identify a validchecksum. A syndrome generator may also be employed. The code has beendesigned such that when the appropriate 188 bytes of bitstream(including the checksum) are multiplied against the parity check matrix,a positive match is indicated when the calculated product produces a47Hex result. (Note that the checksum is calculated based on theprevious 187 bytes and not the 187 bytes yet to be received by theMPEG-2 sync decoder. This is in contrast to the conventional syntax ofan MPEG packet, in which the sync byte is usually described as the firstbyte of a received packet.)

FIG. 1 is a block diagram depicting a prior art MPEG framing block 200at the receiver end. The data stream is serialized and the Serial DataStream is sent through the syndrome generator 210 which is specified inthe ANSI/SCTE 07 2000 standard (see e.g., the syndrome generatorillustrated at FIG. 3 of that standard). The syndrome detector 220compares the output of the syndrome generator 210 with 47Hex for anumber of packets, NP, and a programmable threshold, Synd_thresh, andestablishes whether a sync byte has actually been detected. For example,if during NP packets, the number of syndrome outputs equal to 47Hex isgreater than or equal to Synd_thresh, then a sync byte has beendetected. A Lock_flag indicates whether or not the sync byte has beendetected within the data stream, for example, by being a logic 1 or 0,respectively. A Sync_flag indicates the sync byte position within thedata stream by, for example, being logic 1 during the sync byte and 0otherwise. Once a locked alignment condition is established, the absenceof a valid code word at the expected location will indicate a packeterror. The Error_flag of the previous packet can then be set to 1;otherwise, the packet is considered error free and the Error_flag is setto 0.

On a parallel path, the original Serial Data Stream is appropriatelydelayed (by Delay block 230) and sent to the MPEG sync re-inserter block240 wherein the sync byte is re-inserted in place of the parity checksum(which was created at the transmitter MPEG framing block, not shown).Hence, the data stream output to the transport layer is a restoredstandard MPEG-2 transport stream. This data can be output in eitherserial or parallel mode. Two additional signals not shown in FIG. 1 arealso sent to the transport layer: the clock and the valid or enablesignal associated with the data.

The synchronization de-coupling feature of MPEG-2 was intended tointroduce the flexibility, for example, to enable the system to carryAsynchronous Transfer Mode (ATM) packets easily without interfering withATM synchronization. However, an unintended consequence of this featureis the increased probability of “false locks” in the syndrome detectorof the prior art within the MPEG framing block in FIG. 1.

This happens because the parity check block code encoded in thetransmitter side is not very powerful and its decoder (Syndromegenerator 210) at the receiver end may indicate several places in apacket where a possible sync byte could be found, when only one is thecorrect one. This may occur even when the FEC is perfectly locked anddelivers an error free data stream. Luckily, the typical data streamdoes not generally present a periodic characteristic and after beingprocessed by the parity check block decoder, different packets will tendto have the correct sync positions in common. However, in the case of aperiodic data stream, such as for example a data stream having aconsiderable number of null packets, this problem becomes acute and thesync lock Detector (Syndrome Detector 220) of the prior art may falselylock to one of the several wrong sync byte positions in the packet asidentified by the parity check block decoder and send invalid packets tothe transport block even when the FEC is perfectly locked and deliversan error free data stream. As long as there are enough null packetsmultiplexed in the data stream on a regular basis, this may be enough tokeep the lock detector falsely locked for a long time.

After a lock (synchronization) detection, the MPEG sync re-inserter 240within the MPEG framing block of the prior art inserts the sync byte inthe sync byte position identified by the parity check block decoder,outputs the Sync_flag signal, the Error_flag signal, the valid and clocksignals, and sends the data stream to the transport layer. In the caseof a false lock, the transport layer cannot easily identify a wrongpacket, since it is receiving 188 data bytes, with a first byte expectedto be the sync byte, a valid signal in line with the bytes, and errorsignal indicating an error free packet.

In broadcasting, the data stream may contain repetitive null packets,which may cause the Syndrome Detector 220 within the MPEG framing blockof the prior art to lock to the wrong (synchronization) byte position,thereby producing invalid MPEG-2 packets output to the transport blockeven when the FEC is perfectly locked and delivers an error free datastream.

SUMMARY OF THE INVENTION

The present invention provides a method and apparatus for reliablydetecting MPEG-2 packet sync-byte positions received via a digitaltransmission system in the event of a packet stream containing aplurality of null packets or a plurality of packets containing a fixedrepeating data pattern and for reliably synchronizing and delivering theMPEG-2 stream broadcast to the receiver transport layer. A Null-PacketDetector circuit may be provided to compare the content of the currentpacket with a fixed (or predetermined) bit pattern to detect a MPEG-2null-packet and to reliably identify the location of a checksum-encodedsync-byte within a null-packet. A sync-byte position is identified basedupon the position of the predetermined fixed bit pattern in the headerportion of one or a plurality of null-packets in the stream.

BRIEF DESCRIPTION OF THE DRAWINGS

The above features of the present invention will become more apparent bydescribing in detail exemplary embodiments thereof with reference to theattached drawings in which:

FIG. 1 shows a block diagram of a prior art MPEG framing block at thereceiver end of a digital transmission system;

FIG. 2 is a block diagram of an MPEG framing block at the receiver endof a digital transmission system according to an embodiment of thepresent invention;

FIG. 3 is a flowchart that describes the method performed to determinethe synchronization byte position in the event of null-packets accordingto an embodiment of the present invention; and

FIG. 4 is a flowchart that describes more precisely an algorithm used todetect a data stream containing null-packets in accordance with anotherembodiment of the present invention.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

FIG. 2 is a block diagram of an MPEG framing block 299 at the receiverend of a digital transmission system according to an embodiment of thepresent invention. The MPEG framing block 299 of the present inventionis similar to the MPEG framing block 200 of the prior art depicted inFIG. 1, but may comprise three additional blocks: the null packetdetector 250, the state machine 255 and the decision logic block 260.

The null packet detector 250 detects null packets received in the SerialData Stream.

Null packets usually have a predetermined preamble followed by a fixeddata pattern (e.g., zeros). In a null packet the preamble containsspecific bits within the packet header that are unique for a nullpacket. These are:

a) payload_unit_start_indicator=‘0’.

b) PID=0x1FFF

c) transport scrambling control=‘00’

d) adaptation field=‘01’

In some cases, null packets may also contain the predetermined preamblefollowed by payload data containing a predetermined data pattern (allzeros, or a sequence of bits other than all zeros).

The null packet detector 250 first detects the predetermined Null packetpreamble (e.g., PID equal to 0x1FFFhex (8191 dec)) and, upon thedetection of the predetermined Null packet preamble, begins to determinewhether the subsequent data bits are equal to the expected(predetermined) fixed data pattern (e.g., a series of zeros). If thepredetermined Null packet preamble is detected and the subsequentpredetermined (fixed) data pattern is detected (e.g., equal to zero),then a null packet is considered to be “found” (detected).

In the alternative embodiments, (e.g., to increase the robustness of thenull packet detection against noise and interference), the number ofbits of difference (bit errors) between expected (predetermined) fixeddata pattern and the received payload data is counted and thebit-difference (bit error) count is compared against a programmablethreshold value, Null_thresh. If the preamble is detected but the numberof non-matching bits (bit errors counted) is larger than Null_thresh,then the packet is not considered to be a null packet; otherwise, (ifthe preamble is detected) the packet is considered to be a null packet.Upon the detection of the predetermined Null packet preamble andsubsequently counting a number of bits errors (e.g., ones where thepredetermined data pattern is “all zeros”) that is less than or equal toNull_thresh, the null packet detector will generate a “null-detectsignal” (Null_flag). The Null_flag may be defined, for example, to be alogic “1”, when a null packet is detected and logic “0”, otherwise. Inaddition, the null packet detector 250 creates a Null_sync signal thatindicates the position of the MPEG sync byte within the (null) packet(in the packet stream) as indicated by the detection of a null-packet'spreamble and predetermined data pattern.

To increase detection reliability, the function of the null packetdetector can be moderated by the low-pass filtering function of ahysteretic characteristic. A state machine 255 may be provided followingthe null packet detector 250 to enable the detection circuit to have ahysteretic characteristic that filters out higher frequency fluctuationin the selection of the sync byte position based on the output of thenull detector 250. This feature may be implemented by counting during apredetermined or a programmable number of packets, Npackets1, whetherthe Null_flag is 1 for a count greater than or equal to a designated (orprogrammable) number of threshold packets, Lock_In_thresh, beforedeclaring a null packet detector lock, (whereupon Null_lock is set to1). On the other hand, once Null_lock is 1, the circuit countsoccurrences of Null_lock being 0 during a programmable number ofpackets, Npackets0 (e.g., Npackets0=Npackets1=Npackets), to determinethat the Null_flag has been 0 for a count greater than or equal to adesignated (or programmable) number of threshold packets,Lock_Out_thresh, before declaring a loss of lock, (whereupon Null_lockis set to 0). In some embodiments, the programmable number of packets,Npackets0 and Npackets1, (representing the search “windows” spanning anumber, e.g., Npackets of received packets) may be equal to therespective designated number of threshold packets, (Lock_Out_thresh andLock_In_thresh), but will be preferably larger so that Null_lock is setto 1 (or reset to 0) when a selectable portion (e.g., three quarters) ofreceived packets in a search window are null-packets (or are not nullpackets).

Other variations of the hysteretic characteristic are possible withoutloss of generality, and alternatively, the null packet detector 250 andthe hysteretic characteristic function (of state machine 255) could beimplemented by a microprocessor or ASIC.

The decision logic block 260 operates as follows: When the null packetdetector 250 does not detect a null packet, (e.g., Null_sync=0 andNull_lock=0), the MPEG synchronization output (Sync), is generated bythe checksum based synchronization detector (syndrome generator 210 anddetector 220 blocks) as in the prior art (i.e., the sync byte positionis indicated by the Sync_flag signal determined by the checksum-baseddetector 220). But, when null packets are detected, (and the Null_lockis 1), the MPEG synchronization is determined by the null packetdetector 250, and its output Null_sync will be used as the MPEGsynchronization output (Sync) to be used in the MPEG Sync Re-insertionblock 240. The error output of the decision logic block 260 is the sameas the Error_flag received from the Syndrome Detector 220. The Lockoutput of the decision logic is the Null_lock if Null_lock is 1, and isthe Lock_flag if Null_lock is 0. The decision logic block 260 may beimplemented as a circuit that effectively includes a multiplexor thatmultiplexes the conventional Sync_flag and the Null_sync signal outputfrom the Null Detector 250, selecting one or the other, according to theselection method of the decision logic block 260 as explained above. Inalternative embodiments of the invention, the function of the StateMachine 255 (e.g., Hysteretic characteristic filter) may be merged withand incorporated into the decision logic block 260.

The remaining operative parts of the MPEG framing block 299 generallyoperate the same as in the prior art of FIG. 1.

In some embodiments of this invention, the null packet detector 250 ofthe MPEG framing apparatus (e.g., 299) may be comprised of a detectoradapted to detect the predetermined preamble associated with anull-packet (or more simply, adapted to detect only the PID field equalto 0x1FFFhex (8191 dec)). In other embodiments of this invention, thenull packet detector 250 may first detect the preamble and then proceedto check if the subsequent data bits (in the packet's payload)correspond to a fixed data pattern (e.g., a series of zeros, or allzeros) associated with a null-packet. In some embodiments of theinvention, the (Null_flag) output of the null packet detector 250 isfiltered (e.g., by a hysteretic function performed by a state machine255) to produce a filtered output (Null_lock). In other embodiments ofthe invention, the output of the null packet detector 250 is unfiltered(See FIG. 3).

Operations of an MPEG framing block (e.g., 299 of FIG. 2) in accordancewith embodiments of the invention are further described by referring toFIGS. 3 and 4.

FIG. 3 is a flowchart describing the general method performed to selectthe synchronization byte position according to an embodiment of thepresent invention. In step S1, a Serial Data Stream comprised offixed-length (e.g., 188 byte) packets is received as digitally encoded(MPEG-2) signals conforming to a predetermined protocol (e.g.,conforming to the ANSI/SCTE 07 2000 and ITU-T J.83B standards), theprotocol defining multiple packet types (e.g., null-packets), eachpacket including a header portion (which can include a preambleidentifying a packet as a null-packet) and a payload data portion, theheader portion containing a checksum-encoded sync byte.

In Step S2, the received Serial Data Stream is sent through the syndromegenerator which is specified in the ANSI/SCTE 07 2000 standard (seee.g., the syndrome generator illustrated at FIG. 3 of that standard) andthen a syndrome detector 220 compares the output of the syndromegenerator with the predetermined synchronization checksum to establishwhether a (possible) sync byte has been detected.

If a sync byte is detected by the conventional checksum method performedin Step S2, then Step S3, and either one of Step S4A or Step S4B, andthen Steps S5 and S6 are performed.

In Step S3 it is determined whether the presently received packet is anull packet. If the presently received packet is found to be a nullpacket, then a null flag (Null_flag) is set (e.g., to 1) and Step S4Aand Steps S5 and S6 will be performed; If the presently received packetis not found to be a null packet, then the null flag (Null_flag) isreset (e.g., to 0)) and Step S4B and Steps S5, and S6 will be performed.

Next, in Step S5 the sync byte value (47hex) is re-inserted in the syncbyte position selected by one of Steps S4A and S4B and in Step S6 thedata stream containing the sync byte as restored above is output to thetransport layer as a restored standard MPEG-2 transport stream.

FIG. 4 is a flowchart that describes more precisely an algorithm used todetect whether the data stream contains multiple null-packets, inaccordance with another embodiment of the present invention.

Null-packet detection Step S3B is an alternative to the simplernull-packet detection Step S3 of FIG. 3 and can be performed by the NullDetector 250 and State Machine 255 of FIG. 2, and is comprised ofSubsteps B1, B2 and B3. If a sync byte is detected by the conventionalchecksum method (as performed in Step S2 of FIG. 3), then Step S3B isperformed (and then either one of Step S4A or Step S4B, and then StepsS5 and S6 of FIG. 3 are performed).

In Sub-step B1, it is determined whether the presently received packetcontains the predetermined preamble (e.g., including a PID equal to0x1FFFhex (8191 dec)) associated with a null packet (e.g., in the header(PID) position as indicated by the checksum-based synchronization). Ifthe predetermined Null packet preamble is detected (in the expectedposition) then a null flag (Null_flag) may be tentatively set (e.g.,to 1) subject to the determination made in Substep B2, and Substep B2 isnext performed. If the predetermined Null packet preamble (a first fixedbit pattern) is not detected (in the expected position) then a null flag(Null_flag) is reset (e.g., to 0) and that determination (Null_flag) istransmitted to the Hysteretic Characteristic Substep B3.

In Sub-step B2, it is determined whether the (subsequent) data payloadof the presently received packet contain the predetermined fixed datapattern (a second fixed bit pattern, e.g., a series of zeros or allzeros). The bit-difference (error bit count) between the received dataand the predetermined (fixed) data pattern is counted and is comparedwith a programmable threshold, Null_thresh. If the predetermined (fixed)data pattern is detected (e.g., data bits equal to zero or error-bitcount is less than or equal to Null_thresh), then a null packet isconsidered to be “found” (detected) and the null flag (Null_flag) is set(e.g., to 1) and Substep B3 is next performed.

If the predetermined fixed data pattern (e.g., a series of zeros or allzeros) is not detected (within the Null_thresh threshold) then a nullflag (Null_flag) is reset (e.g., to 0) and that determination(Null_flag) is transmitted to the Hysteretic Characteristic Substep B3.Thus, if the predetermined (fixed) data pattern is not detected (e.g.,to many error bits are counted), then a null packet is considered to benot “found” (detected) and the null flag (Null_flag) is reset (e.g., too) and Substep B3 is next performed.

In Substep B3 the Null_flag signal resulting from either of Substep B1or B2 is filtered (e.g., by a hysteretic characteristic). This filteringcan be implemented by a state machine (e.g., 255 of FIG. 2) reduce rapidfluctuations in the flag indicating a detection of a null packet (e.g.,by the Null Detector 250 of FIG. 2) which is used to identify the trueposition of MPEG-2 sync bytes in the packets received via the SerialData Stream. The details of performing such a hysteretic characteristicfilter can be the same as those previously noted in connection with theabove description of the operation of the State Machine 255 of FIG. 2,wherein the determined null packet status of a number (e.g., Npackets isgreater than one) of packets are examined to determine the decisionoutput of the state machine (to select the performance of either StepS4A or S4B of FIG. 3). The result of filtering Substep B3 is then usedto select the performance of either Step S4A or Step S4B FIG. 3, andthereafter, Steps S5 and S6 will be performed.

An embodiment of the present principles may involve, for example, acomputer program product for a set-top-box that comprises a set ofinstructions, which, when loaded into the set-top-box, causes theset-top-box to carry out the method, for processing a stream of fixedlength packets, described herein above. Moreover, another embodiment ofthe present principles may involve, for example, a computer programproduct for a television set that comprises a set of instructions,which, when loaded into the television set, causes the television set tocarry out the method, for processing a stream of fixed length packets,as described herein above.

Exemplary embodiments of the invention have been explained above and areshown in the figures. However, the present invention is not limited tothe exemplary embodiments described above, and it is apparent thatvariations and modifications can be effected by those skilled in the artwithin the spirit and scope of the present invention. Therefore, theexemplary embodiments should be understood not as limitations but asexamples. The scope of the present invention is not determined by theabove description but by the accompanying claims, and variations andmodifications may be made to the embodiments of the invention withoutdeparting from the scope of the invention as defined by the appendedclaims and equivalents.

1. An apparatus, comprising: a Null-Packet Detector for processing astream of fixed-length packets received by said apparatus as digitallyencoded signals and having multiple packet types, each packet includinga header portion and a data portion, the header portion including a syncbyte, wherein said Null-Packet Detector processes the stream bydetecting whether a received packet is a null-packet and for identifyingthe location of the sync-byte of a detected null-packet, and wherein theNull-Packet Detector further generates a first signal to indicatewhether a received packet is a null-packet and generates a second signalto indicate the location of the sync-byte of a detected null-packet. 2.The apparatus of claim 1, further comprising a circuit adapted to inserta predetermined sync-byte value into the sync-byte position indicated bythe second signal.
 3. The apparatus of claim 1, further comprising afilter adapted to filter the first signal and adapted to generate aNull_lock signal a first value of which indicates that the streamcontains a plurality of null packets.
 4. The apparatus of claim 3wherein the filter implements hysteresis thresholding.
 5. The apparatusof claim 3 wherein the filter is implemented by a finite state machine.6. The apparatus of claim 3, wherein the first value of Null_lock signaloutput by the filter indicates that the stream contains a firstthreshold number of null-packets (Lock_In_thresh) within a first numberof consecutive packets.
 7. The apparatus of claim 6, wherein at leastone of the first threshold number and the first number of consecutivepackets is programmable.
 8. The apparatus of claim 6, wherein a secondvalue of the Null_lock signal output by the filter indicates that thestream contains a second threshold number (Lock_Out_thresh) of packetsthat are not null packets, within a second number of consecutivepackets.
 9. The apparatus of claim 8, wherein at least one of the firstthreshold number, and the second threshold number is programmable. 10.The apparatus of claim 1, wherein the Null-Packet Detector determineswhether a received packet is a null-packet by comparing contents of theheader portion of the received packet with a first predetermined value.11. The apparatus of claim 10, wherein the Null-Packet Detectordetermines whether a received packet is a null-packet by furthercomparing contents of the data portion of the received packet with asecond predetermined value.
 12. An apparatus comprising: a SyndromeDetector for processing a stream of fixed-length packets received bysaid apparatus as digitally encoded signals and having multiple packettypes, each packet including a header portion and a data portion, theheader portion including a checksum-encoded sync byte, the streamprocessed by detecting the checksum-encoded sync-byte and generating aSync_flag signal to indicate the location of the checksum-encodedsync-byte; a Null-Packet Detector adapted to detect whether a receivedpacket is a null-packet, and adapted to identify the location of thesync-byte of a detected null-packet; and an MPEG Sync-Byte Re-insertioncircuit for inserting a predetermined value into the sync-byte locationindicated by an MPEG synchronization signal.
 13. The apparatus of claim12, wherein the Null-Packet Detector is further adapted to output aNull_sync signal to indicate the location of the sync-byte of a detectednull-packet.
 14. The apparatus of claim 13, further comprising: amultiplexor, wherein the Sync_flag output of the Syndrome Detector andthe Null_sync output of the Null-Packet Detector are multiplexed and arealternatively output by the multiplexor, to be used by the MPEGSync-Byte Re-insertion circuit, according to whether null packets havebeen detected.
 15. The apparatus of claim 14, further comprising adecisional logic circuit operatively connected to the multiplexor andadapted to control the multiplexor so that when the Null-Packet Detectordetects null packets, the Null_sync output of the Null Packet Detectoris output by the multiplexor to be used as the MPEG synchronizationsignal by the MPEG Sync-Byte Re-insertion circuit.
 16. The apparatus ofclaim 13 adapted so that when null packets are detected, the Null_syncoutput of the Null Packet detector is used as the MPEG synchronizationsignal used by the MPEG Sync Re-insertion circuit.
 17. The apparatus ofclaim 16, wherein when null packets are not detected, the Null_syncoutput of the Null Packet detector is not used as the MPEGsynchronization signal used by the MPEG Sync Re-insertion circuit. 18.The apparatus of claim 17, wherein when null packets are not detected,the Sync_flag output by the Syndrome Detector is used as the MPEGsynchronization signal used by the MPEG Sync Re-insertion circuit.
 19. Amethod comprising: processing a stream of fixed length packets receivedby said method as digitally encoded signals, each packet including achecksum-encoded sync-byte, the stream including a plurality of packetsthat each contain a first fixed bit pattern in the header portion ofeach packet, wherein said processing step comprises: performing a firstdetection step of decoding the checksum in the stream to detect achecksum-encoded sync byte position candidate in the current one of thefixed length packets; performing a second detection step to detect thefirst fixed bit pattern in the header portion of the current one of thefixed length packets; if the first fixed bit pattern is detected in thestream of fixed length packets, then identifying the sync-byte positionof the sync-byte of each of the fixed length packets based upon thedetection of the first fixed bit pattern; and inserting a predeterminedsync-byte value into the identified sync-byte position.
 20. The methodof claim 19, wherein the second detection step is performed only if achecksum-encoded sync byte position candidate is detected in the firstdetection step.
 21. The method of claim 19, wherein while the firstfixed bit pattern is not detected in the stream of fixed length packets,then identifying the sync-byte position of the sync-byte of each of thefixed length packets in the stream based upon the result of the firstdetection step; and inserting the predetermined sync-byte value into thesync-byte position candidate based upon the result of the firstdetection step.
 22. The method of claim 19, wherein if achecksum-encoded sync byte candidate is detected in the first detectionstep, but the first fixed bit pattern is not detected by the seconddetection step, then inserting a predetermined sync-byte value into thesync-byte position candidate based upon the result of the firstdetection step.
 23. The method of claim 19, wherein the second detectionstep is performed even if a checksum-encoded sync byte candidate is notdetected in the first detection step.
 24. The method of claim 19,wherein the first fixed bit pattern is a predetermined bit pattern inthe header portion of each packet within the plurality of packets. 25.The method of claim 24, wherein said header portions comprise transportheaders of an MPEG-2 Transport Stream.
 26. The method of claim 19,wherein the first fixed bit pattern is a predetermined pattern thatincludes at least one of the following MPEG-2 transport stream linkheader field values: payload_unit_start_indicator =‘0’, PID=0x1FFF,transport scrambling control=‘00’, and adaptation field=‘01’.
 27. Themethod of claim 19, wherein each of the plurality of packets is anMPEG-2 null-packet.
 28. The method of claim 19, wherein each packet inthe plurality of packets that each contain a first fixed bit pattern ina header portion of each packet further contains a second fixed bitpattern within the data portion of each packet; and further comprising:performing a third detection step to detect the second fixed bit patternin the plurality of packets within the stream of fixed length packets,and if the second fixed bit pattern is detected in the stream of fixedlength packets, then inserting the predetermined sync-byte value intothe sync-byte position based upon the result of the third detectionstep.
 29. The method of claim 27, wherein the third detection step isperformed only if a checksum-encoded sync byte position candidate isdetected in the first detection step.
 30. The method of claim 27,wherein if neither of the first and second detection steps hasidentified a sync byte position, then no predetermined sync-byte valueis inserted in the stream of fixed length packets.
 31. The method ofclaim 27, wherein the third detection step is performed only if thefirst fixed bit pattern is detected in the stream of fixed lengthpackets in the second detection step.
 32. The method of claim 27,wherein if the second fixed bit pattern is not detected in the stream offixed length packets, then identifying the sync-byte position of thesync-byte of each of the fixed length packets based upon the result ofthe first detection step.
 33. A method comprising: processing a streamof fixed length packets received by said method as digitally encodedsignals, each packet including a checksum-encoded sync-byte, the streamincluding a plurality of packets that each contain a first data patternin a PID portion, wherein said processing step comprises: decoding thechecksum in a preceding one of the fixed length packets to detect achecksum-encoded sync byte candidate in a current one of the fixedlength packets; and if a checksum-encoded sync byte candidate isdetected in the decoding step, then searching for the first data patternin the PID portion of the current one of the fixed length packets. 34.An apparatus comprising: means for processing a stream of fixed lengthpackets received by said apparatus as digitally encoded signals, eachpacket including a checksum-encoded sync-byte, the stream including aplurality of packets that each contain a first data pattern in a PIDportion, wherein said means for processing comprises: means for decodingthe checksum in a preceding one of the fixed length packets to detect achecksum-encoded sync byte candidate in a current one of the fixedlength packets; and means for searching for the first data pattern inthe PID portion of the current one of the fixed length packets when achecksum-encoded sync byte candidate is detected in the decoding step.35. A computer program product for a set-top-box that comprises a set ofinstructions, which, when loaded into the set-top-box, causes theset-top-box to carry out the method, for processing a stream of fixedlength packets, claimed in claim
 19. 36. A computer program product fora television set that comprises a set of instructions, which, whenloaded into the television set, causes the television set to carry outthe method, for processing a stream of fixed length packets, claimed inclaim 19.